package main

//1.题目：有1、2、3、4个数字，能组成多少个互不相同且无重复数字的三位数？都是多少？
func main() {
	test1()
	test2()
}

func test2() {
	count := 0
	sum := 0
	for i := 1; i <= 4; i++ {
		for j := 1; j <= 4; j++ {
			if i == j {
				continue
			}
			for k := 1; k <= 4; k++ {
				count++
				if i == k || j == k {
					continue
				}
				sum++
				//fmt.Println(i*100 + j*10 + k)
			}
		}

	}
	println("test2:", count, sum)
}

func test1() {
	count := 0
	sum := 0
	for i := 1; i <= 4; i++ {
		for j := 1; j <= 4; j++ {
			for k := 1; k <= 4; k++ {
				count++
				if i != j && i != k && j != k {
					//fmt.Println(i*100 + j*10 + k)
					sum++
				}
			}
		}
	}
	println("test1:", count, sum)
}
